fix(actor): adapt PlatformEventManager to crawlee v4 EventManager API#594
Open
B4nan wants to merge 8 commits into
Open
fix(actor): adapt PlatformEventManager to crawlee v4 EventManager API#594B4nan wants to merge 8 commits into
B4nan wants to merge 8 commits into
Conversation
4f65fb8 to
f5d0e03
Compare
076c1eb to
cc2c4dd
Compare
5491e94 to
691c7ce
Compare
89d0f5c to
b4ea1e5
Compare
7c740df to
28eab9a
Compare
b4ea1e5 to
fd14806
Compare
fd14806 to
c1f975a
Compare
79c7560 to
dec3f6c
Compare
dec3f6c to
43cf6a4
Compare
B4nan
added a commit
that referenced
this pull request
May 12, 2026
Crawlee v4's `EventManager` constructor now requires `EventManagerOptions` (just `persistStateIntervalMillis`), and the base class no longer carries a `config` field — the previous `override readonly config` pattern is no longer valid. - Drop the `override` and store `config` as own readonly property. - Forward `persistStateIntervalMillis` to `super()`. - Add a `fromConfig()` factory mirroring `LocalEventManager.fromConfig()` so the SDK plays nicely with the new ServiceLocator-driven init path. Stacked on #583 (config redesign); rebases onto v4 once that lands.
`Configuration.useEventManager()` was removed in crawlee v4. Install the platform event manager via the global service locator instead, and reset between tests so each case can register a fresh manager without hitting `ServiceConflictError`.
Crawlee v4's `Configuration` is eager — `actorEventsWsUrl` is read once at construction, so a global config that pre-existed the `beforeEach` would never see the websocket URL we set, and `events.init()` would silently never connect. Move the env-var setup above `Configuration.getGlobalConfig()` and reset the SDK's static singleton so each test rebuilds a fresh config.
43cf6a4 to
f5f4e1b
Compare
B4nan
added a commit
that referenced
this pull request
May 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Crawlee v4's
EventManagerconstructor changed:EventManagerOptions(justpersistStateIntervalMillis).configfield — the previousoverride readonly configpattern is invalid.This PR adapts
PlatformEventManager:override; storesconfigas own readonly property.persistStateIntervalMillistosuper().fromConfig()factory mirroringLocalEventManager.fromConfig()so the SDK plays nicely with the new ServiceLocator init path.Stacking
Depends on #583 (config redesign). Rebases cleanly onto v4 once #583 lands.